@layout("/common/default.html",{title:'代码生成配置添加',libs:['form']}){

<!--form表单-->
<form class="layui-form"  lay-filter="layui-form-gen" id="layui-form-gen">

    <input type="hidden" id="onlyid" name="id" value="${genConfig.id}">
    <input type="hidden"  id="op" value="${genConfig.op}">

    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">基本信息</div>

            <div class="layui-card-body">
                <div class="layui-form-item layui-row">

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label layui-required">属性</label>
                        <div class="layui-input-block">
                            <input type="text"  id="property" name="property" value="${genConfig.property!}" lay-verify="required"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label layui-required">名称</label>
                        <div class="layui-input-block">
                            <input type="text"  id="name" name="name" value="${genConfig.name!}" lay-verify="required"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label layui-required">值</label>
                        <div class="layui-input-block">
                            <input type="text"  id="value" name="value" value="${genConfig.value!}" lay-verify="required"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline layui-col-md9">
                        <label class="layui-form-label layui-required">描述</label>
                        <div class="layui-input-block">
                            <input type="text"  id="remarks" name="explain" value="${genConfig.remarks!}" lay-verify="required"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
    <div class="form-group-bottom" style="z-index: 200" align="center">
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>&emsp;提交&emsp;</button>
        <button   id="btnclose" class="layui-btn layui-btn-primary"  >&emsp;取消&emsp;</button>
    </div>

</form>
<script>
    layui.use(['form'], function () {
        var $ = layui.$,
            form = layui.form,
            submitform =layui.submitform;


         //为表单付出始值
            form.val('layui-form-gen', {
            });

        form.on("submit(btnSubmit)", function (data) {
            var field=data.field;
            // 请求后台
            submitform.form('/gen/genConfig/save',field);

            return false;
        });


        });
</script>

@}
